load("@fbcode//quic:defs.bzl", "mvfst_cpp_binary", "mvfst_cpp_library")

oncall("traffic_protocols")

mvfst_cpp_library(
    name = "echo_handler",
    headers = [
        "EchoClient.h",
        "EchoHandler.h",
        "EchoServer.h",
        "EchoTransportServer.h",
        "LogQuicStats.h",
    ],
    exported_deps = [
        "fbcode//fizz/backend:openssl",
        "fbcode//fizz/compression:zlib_certificate_decompressor",
        "fbcode//fizz/compression:zstd_certificate_decompressor",
        "fbcode//folly:file_util",
        "fbcode//folly:synchronized",
        "fbcode//folly/fibers:core",
        "fbcode//folly/io/async:scoped_event_base_thread",
        "fbcode//quic:constants",
        "fbcode//quic:exception",
        "fbcode//quic/api:transport",
        "fbcode//quic/client:client",
        "fbcode//quic/codec:types",
        "fbcode//quic/common:buf_util",
        "fbcode//quic/common/events:folly_eventbase",
        "fbcode//quic/common/test:test_client_utils",
        "fbcode//quic/common/test:test_utils",
        "fbcode//quic/common/udpsocket:folly_async_udp_socket",
        "fbcode//quic/fizz/client/handshake:fizz_client_handshake",
        "fbcode//quic/server:server",
        "fbcode//quic/state:stats_callback",
    ],
    exported_external_deps = [
        "glog",
    ],
)

mvfst_cpp_binary(
    name = "echo",
    srcs = [
        "main.cpp",
    ],
    deps = [
        ":echo_handler",
        "//fizz/crypto:utils",
        "//folly/init:init",
        "//folly/portability:gflags",
    ],
    external_deps = [
        "glog",
    ],
)
